package org.prem.collection.comparator;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class TestDogComparable {

	public static void main(String[] args){
		List<DogStringComparable> arlst = new ArrayList<DogStringComparable>();
		arlst.add(new DogStringComparable("Tommy",2));
		arlst.add(new DogStringComparable("Finny",8));
		arlst.add(new DogStringComparable("Jimmy",1));
		arlst.add(new DogStringComparable("Rocky",4));
		arlst.add(new DogStringComparable("Jockey",3));
		System.out.println("Before sorting");
		for(DogStringComparable d : arlst){
			System.out.println("Dog--->"+d.getName());
		}
		Collections.sort(arlst);
		System.out.println("After sorting");
		for(DogStringComparable d : arlst){
			System.out.println("Dog--->"+d.getName());
		}
	}
}
